<template>
    <div class="container">
        <van-nav-bar title="投递记录" left-arrow @click-left="onClickLeft">
        </van-nav-bar>
        <div class="cont">
            <template v-for="(item, index) in list" :key="index">
                <div class="item">
                    <div class="box">
                        {{ item.deviceAddress }}
                    </div>
                    <div class="box1">
                        <text>投递时间:</text>
                        <text>{{ item.deliveryTime.replace(/-/g, ".").replace("T", " ") }}</text>
                    </div>
                    <div class="box1">
                        <text>投递重量:</text>
                        <text>{{ item.weight }}KG</text>
                    </div>
                </div>
            </template>
        </div>
    </div>

</template>

<script setup>
import { useRoute } from 'vue-router'
import { getRecord } from '@/api/RemoveList'
import { ref } from 'vue'
// // 获取当前路由对象
// const route = useRoute()
// const code = route.query.id
// 总列表
const list = ref([])
// 判断
const onClickLeft = () => {
    history.back()
}
const getlist = () => {
    // const data = {
    //     code: code
    // }
    getRecord()
        .then(res => {
            if (res.data.code = 200) {
                list.value = res.data.dataset.list;
            }
        })
}
getlist()


</script>

<style lang="less" scoped>
.container {
    height: 100vh !important;
    background: #f9f9f9;
}

.van-nav-bar {
    background-color: #fff !important;
}

:deep(.van-icon,
    .van-badge__wrapper) {
    color: #000 !important;
}

.cont {
    width: 100vw;
    height: auto;
    box-sizing: border-box;
    padding: 5vh 5vw;
}

.item {
    width: 100%;
    height: 20vh;
    background-color: #fff;
    border-radius: 2vh;
    position: relative;
    display: flex;
    box-sizing: border-box;
    padding: 2vh 5vw;
    flex-direction: column;
    justify-content: space-evenly;
}


.item::after {
    content: '';
    /* 伪元素必须有 content */
    position: absolute;
    top: 20%;
    /* 定位到文字底部 */
    left: 0;
    /* 水平居中 */
    transform: 0;
    /* 精准居中 */
    height: 15%;
    /* 短横线长度 */
    width: 1.5em;
    /* 短横线厚度 */
    background-color: #FF8000;
    /* 短横线颜色 */
    z-index: 222;
}

.box {
    font-size: 5vw;
    font-weight: 600;
}

.box1 {
    font-size: 4vw;
}
</style>
